#include <iostream>
#include <stdlib.h>
#include <Schema.h>
#include <File.h>

int main(){
	
		//Create FILE link to the lineitem table
		FILE *lineItemDB = fopen("/home/abhijeet/ufl/dbi/db/lineitem.tbl", "r");
		
		//Check if the fopen succeeded or not
		if ( lineItemDB == NULL ){
			cout << "failed to open the file " << endl;
			exit(1);
		}
		
		//Create a schema for lineitem table
		Schema lineItemSchema("catalog", "lineitem");
		
		//Record variable to read data from the database file
		Record record;
		
		while ( record.SuckNextRecord(&lineItemSchema,lineItemDB)){
			record.Print( &lineItemSchema );
		}
		
		fclose(lineItemDB);
		
		return 0;
	
}
